package com.college.common.constant;

/**
 * Exception 拦截
 *
 * @author 小C工作室
 */
public enum ExceptionCodeEnum implements ExceptionHandler {
	// 数据操作错误定义
	SUCCESS(200, "操作成功"),
	ING(203, "进行中"),
	FAILED(500, "操作失败"),
	PRAM_NOT_MATCH(400, "参数不正确"),
	VALIDATE_FAILED(400, "参数检验失败"),
	NULL_POINT(20007, "空指针异常"),
	VALIDATE_FUN_PASSWORD_FAILED(400, "交易密码校验失败"),
	UNAUTHORIZED(401, "未登录或token过期，请登录！"),
	FORBIDDEN(403, "没有相关权限"),
	TOKEN_OVERDUE(403, "登录已过期，请重新登录"),
	NOT_FOUND(404, "没有找到相关数据"),
	ERROR(500, "网络异常"),
	UNKNOWN_ERROR(501, "未知异常"),
	RATE_LIMIT_ERROR(502, "限流异常"),
	FILE_ERROR(510, "上传文件不得为空"),
	BUSINESS_ERROR(3001, "网络异常，请稍后再试！");

	private final Integer code;

	private final String message;

	ExceptionCodeEnum(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	@Override
	public Integer getCode() {
		return code;
	}

	@Override
	public String getMessage() {
		return message;
	}

}
